package com.java.design.decker;

/**
 * @author Tony
 */
public class Soy extends CondimentDecorator{

    Beverage beverage;

    public Soy(Beverage beverage){
        this.beverage = beverage;
    }

    @Override
    public Integer getSize() {
        return beverage.getSize();
    }

    @Override
    public double cost() {
        double cost = 0.15 + beverage.cost();
        if(getSize().equals(Beverage.TALL)){
            cost += 0.10;
        } else if(getSize().equals(Beverage.GRANDE)){
            cost += 0.15;
        }else if(getSize().equals(Beverage.VENTI)){
            cost += 0.20;
        }
        return cost;
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Soy";
    }
}
